@page "/Grouped_Bar_Chart"

<Bar Data=data1 Config="config1" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <Bar @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }

    #region 示例1

    object[] data1 = new object[] {
        new  {
    label= "Mon.",
    type= "series1",
    value= 2800,
  },
        new  {
    label= "Mon.",
    type= "series2",
    value= 2260,
  },
        new  {
    label= "Tues.",
    type= "series1",
    value= 1800,
  },
        new  {
    label= "Tues.",
    type= "series2",
    value= 1300,
  },
        new  {
    label= "Wed.",
    type= "series1",
    value= 950,
  },
        new  {
    label= "Wed.",
    type= "series2",
    value= 900,
  },
        new  {
    label= "Thur.",
    type= "series1",
    value= 500,
  },
        new  {
    label= "Thur.",
    type= "series2",
    value= 390,
  },
        new  {
    label= "Fri.",
    type= "series1",
    value= 170,
  },
        new  {
    label= "Fri.",
    type= "series2",
    value= 100,
  },
};

    BarConfig config1 = new BarConfig()
    {
        IsGroup = true,
        XField = "value",
        YField = "label",
        SeriesField = "type",
        Color = new string[] { "#1383ab", "#c52125" },
        Label = new BarViewConfigLabel
        {

        },
    };

    #endregion 示例1


}

